import type { TableColumn, FormField } from '@/components'
import { reactive } from 'vue'

export const fields = reactive<FormField[]>([
  {
    key: 'name',
    label: '昵称',
    tag: 'ElInput'
  }
])

export const columns: TableColumn[] = [
  {
    key: 'name',
    label: '名称'
  },
  {
    key: 'created_at',
    label: '创建日期'
  },
  {
    key: 'actions',
    label: '操作',
    slot: true,
    fixed: 'right'
  }
]

export const dialogFields = reactive<FormField[]>([
  {
    label: '地区',
    key: 'parent_id',
    tag: 'MTreeSelect',
    required: true,
    attrs: {
      disabled: true,
      props: {
        value: 'id',
        label: 'name'
      },
      data: []
    }
  },
  {
    key: 'name',
    label: '名称',
    tag: 'ElInput',
    required: true
  },
  {
    key: 'code',
    label: '编码',
    tag: 'ElInput'
  }
])
